<?$tour = $this->tour;?>
<? $meta = unserialize($tour['metadata']);
   $poster_name = $meta['poster_name'];
?> 
<?
	$sess = new Zend_Session_Namespace(CLU_NS);
?>
<? if (strpos($sess->userPermissions, 'update tour')) :?>
<div style="background-color:#eee;text-align:right">
<a href="<?=$this->hvnUrl(array('module' => 'tour', 'action' => 'edit'))?>?id=<?=$tour['id']?>"><?=t(135)?></a>
| 
	<? $languages =  Zend_Registry::get('configuration')->languages;?>
	<?=t(90)?>: 
	<? foreach ($languages as $k=>$v) :?>
        <? if ($k != $tour['article']['article_language']) :?> 
    		<a style="text-decoration:none" href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$tour['article']['article_id']?>&to=<?=$k?>"><?=substr(strstr($v,'_'),1)?></a>,
    	<?endif?>
    <?endforeach?>
    
</div>
<?endif ?>

<h1> <?= $tour['article']['article_title'] ?></h1>

<div style="border: 1px solid #C6C8C7; background: #BCECF6; padding-left:5px;">
    <div style="float:left; width:310px; text-align:center;"><span class="db-keyword">Inbound</span> </div>
	<div style="float:left; border-left: 1px solid #C6C8C7; padding-left:5px; ">
		<span class="db-keyword"><?=t(846)?></span>
	</div>
	<div style="clear:both"></div>
</div>

<div style="border: 1px solid #C6C8C7;  background: #EEFEFE;">
	<div style="float:left; border-right: 1px solid #C6C8C7 ;width:310px; padding-left:5px;" >
		<span class="db-keyword"><?=t(822) ?></span>: <?=$tour['itinery'] ?>
		<br/>
		<span class="db-keyword"><?=t(811) ?></span> :<?=$tour['price'] ?> <?=$tour['price_currency'] ?>   
		<br/>
		<span class="db-keyword"><?=t(819) ?></span>: <?=$tour['total_duration']?> <?=t(826) ?> 
		<br/>
		<span class="db-keyword"><?=t(816) ?></span>: <?=$tour['category'] ?>
	</div>
	<div style="width: 310px;float:left; border-left: 1px solid #C6C8C7 ;padding-left:10px">
		<?=$tour['organizer_contact'];?>
		<?=t(823) ?>
		<?if (empty($tour->organizer_website)) :?>
		<?=$tour['organizer_name'] ?>
		<?else:?>
		<a href="<?=$tour['organizer_website'] ?>"> <?=$tour['organizer_name'] ?> </a>
		<?endif ?>
	</div>
	<div style="clear:both"></div>
</div>

<br/>

<br/>
<!--</?=t(21) ?>:-->
<span style="text-align: justify">
	<?=$tour['article']['article_body'] ?>
</span>
<br/>

<b> <?=t(828) ?> </b>
<br/>
<?if (count ($tour['legs']) > 0) :?>
<div style="margin-left:30px">
<? foreach ($tour['legs'] as $leg_num => $leg) :?>
<?$meta = unserialize($leg['leg']['metadata'])?>
    <div style="border:1px solid #d8d9d9;margin:3px;padding-left:5px;"> # <?=$leg['leg']['leg_number']?>
        <!--
        </?if ($meta['departure_place_name'] != $meta['arrival_place_name']) :?> 
        <br/></?=t(17) ?><b> </?=$meta['departure_place_name']?> </b> ---- <b> </?=$meta['arrival_place_name'] ?></b>
        </?else :?>
    	</?endif ?>-->
        <!--</?=t(829) ?>-->
        
        <b><?=$this->aTlegData[$leg_num - 1]['article_title'] ?></b> 
        <br/><br/>
	        <?=$this->aTlegData[$leg_num - 1]['article_body'] ?>
        <?if ($this->edit_allowed) :?>
	        <div style="text-align:right"> <a href="<?= $this->hvnUrl(array('module'=>'tour', 'action'=>'edit-tleg')) . '?id=' . $leg['leg']['id'] . '&tid=' . $tour['id']?>">
	        <?=t(38) ?></a>
        	<? if (strpos($sess->userPermissions, 'update tour')) :?>
				| 
				<? $languages =  Zend_Registry::get('configuration')->languages;?>
				<?=t(90)?>:
				<? foreach ($languages as $k=>$v) :?>
			        <? if ($k != $this->aTlegData[$leg_num - 1]['article_language']) :?> 
			    		<a style="text-decoration:none" href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$leg['article']['article_id']?>&to=<?=$k?>"><?=substr(strstr($v,'_'),1)?></a>,
			    	<?endif?>
			    <?endforeach?>
				</div>
			<?endif ?>
        <?endif ?>        
    </div>
<?endforeach ?>
</div>
<?endif ?>

<!--
<br/>
</?=t(825) ?>: </?=$tour['organizer_contact']?>
</?if ($this->edit_allowed) :?>
<span style="align:right"> <a href="</?=$this->hvnUrl(array('module'=>'tour', 'action'=>'edit')) . '?id=' .$tour['id'] ?>">
</?=t(38) ?></a>
</span>
</?endif ?>
-->
